#ifndef __M_CONSUMER_H__
#define __M_CONSUMER_H__
#include "../mqCommon/logger.hpp"
#include "../mqCommon/helper.hpp"
#include "../mqCommon/mq_msg.pb.h"
#include <iostream>
#include <memory>
#include <mutex>
#include <functional>
#include <unordered_map>

namespace yqx{
    using ConsumerCallback = std::function<void(const std::string, const BasicProperties*, const std::string)>;
    struct Consumer{
        using ptr = std::shared_ptr<Consumer>;
        std::string _tag;//消费者标识
        std::string _qname;//消费者订阅的队列名称
        bool _auto_ack;//自动确认标识
        ConsumerCallback _callback;

        Consumer(){}
        Consumer(const std::string& tag, const std::string& qname, bool auto_ack, const ConsumerCallback& cb):
        _tag(tag), _qname(qname), _auto_ack(auto_ack), _callback(std::move(cb))
        {}
    };
}
#endif